/*
	Copyright (c) 2010 <copyright holders>
	This source code is licensed under The MIT License,
	see the file LICENSE for details.
	*/

#include "Net.hpp"

namespace spelprog2 {
namespace net {

Net::Net(bool isServer) : MessageListenerRegistry<NetMessageInfo>(),
    vars(isServer),
    service(),
    isServer_(isServer)
{
    vars.setNetwork(this);

    netlog << "Constructed Net service";
}

Net::~Net()
{
}

void Net::poll()
{
    //TODO: handle exceptions here or leave to caller?
    service.poll();
}

void Net::run()
{
    //TODO: handle exceptions here or leave to caller?
    service.run();
}

}; //namespace net
}; //namespace spelprog2
